import request from '@/utils/request'

// 查询工作流程列表
export function listSysWorkflow(query) {
  return request({
    url: '/system/sysWorkflow/list',
    method: 'get',
    params: query
  })
}

// 初始化
export function initBean() {
    return request({
        url: '/system/sysWorkflow/initBean',
        method: 'post'
    })
}

// 查询工作流程详细
export function getSysWorkflow(wid) {
  return request({
    url: '/system/sysWorkflow/' + wid,
    method: 'get'
  })
}

// 新增工作流程
export function addSysWorkflow(data) {
  return request({
    url: '/system/sysWorkflow',
    method: 'post',
    data: data
  })
}

// 修改工作流程
export function updateSysWorkflow(data) {
  return request({
    url: '/system/sysWorkflow',
    method: 'put',
    data: data
  })
}

// 删除工作流程
export function delSysWorkflow(wid) {
  return request({
    url: '/system/sysWorkflow/' + wid,
    method: 'delete'
  })
}

// 状态修改
export function changeWorkflowStatus(wid, status) {
  const data = {
    wid,
    status
  }
  return request({
    url: '/system/sysWorkflow/changeStatus',
    method: 'put',
    data: data
  })
}
